// Copyright 2024 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This code was autogenerated. Do not edit directly.
// GENERATED CODE -- DO NOT EDIT!

// Original file comments:
// Copyright 2020 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
'use strict';
var beta_pb = require('./beta_pb.js');
var google_api_annotations_pb = require('./google/api/annotations_pb.js');
var google_api_client_pb = require('./google/api/client_pb.js');
var google_api_field_behavior_pb = require('./google/api/field_behavior_pb.js');
var google_api_resource_pb = require('./google/api/resource_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var google_protobuf_field_mask_pb = require('google-protobuf/google/protobuf/field_mask_pb.js');
var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js');
var protoc$gen$openapiv2_options_annotations_pb = require('./protoc-gen-openapiv2/options/annotations_pb.js');

function serialize_agones_dev_sdk_beta_AddListValueRequest(arg) {
  if (!(arg instanceof beta_pb.AddListValueRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.AddListValueRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_AddListValueRequest(buffer_arg) {
  return beta_pb.AddListValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_Counter(arg) {
  if (!(arg instanceof beta_pb.Counter)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.Counter');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_Counter(buffer_arg) {
  return beta_pb.Counter.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_GetCounterRequest(arg) {
  if (!(arg instanceof beta_pb.GetCounterRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.GetCounterRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_GetCounterRequest(buffer_arg) {
  return beta_pb.GetCounterRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_GetListRequest(arg) {
  if (!(arg instanceof beta_pb.GetListRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.GetListRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_GetListRequest(buffer_arg) {
  return beta_pb.GetListRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_List(arg) {
  if (!(arg instanceof beta_pb.List)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.List');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_List(buffer_arg) {
  return beta_pb.List.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_RemoveListValueRequest(arg) {
  if (!(arg instanceof beta_pb.RemoveListValueRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.RemoveListValueRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_RemoveListValueRequest(buffer_arg) {
  return beta_pb.RemoveListValueRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_UpdateCounterRequest(arg) {
  if (!(arg instanceof beta_pb.UpdateCounterRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.UpdateCounterRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_UpdateCounterRequest(buffer_arg) {
  return beta_pb.UpdateCounterRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_agones_dev_sdk_beta_UpdateListRequest(arg) {
  if (!(arg instanceof beta_pb.UpdateListRequest)) {
    throw new Error('Expected argument of type agones.dev.sdk.beta.UpdateListRequest');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_agones_dev_sdk_beta_UpdateListRequest(buffer_arg) {
  return beta_pb.UpdateListRequest.deserializeBinary(new Uint8Array(buffer_arg));
}


// SDK service to be used in the GameServer SDK to the Pod Sidecar
var SDKService = exports['agones.dev.sdk.beta.SDK'] = {
  // Gets a Counter. Returns NOT_FOUND if the Counter does not exist.
getCounter: {
    path: '/agones.dev.sdk.beta.SDK/GetCounter',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.GetCounterRequest,
    responseType: beta_pb.Counter,
    requestSerialize: serialize_agones_dev_sdk_beta_GetCounterRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_GetCounterRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_Counter,
    responseDeserialize: deserialize_agones_dev_sdk_beta_Counter,
  },
  // UpdateCounter returns the updated Counter. Returns NOT_FOUND if the Counter does not exist (name cannot be updated).
// Returns OUT_OF_RANGE if the Count is out of range [0,Capacity].
updateCounter: {
    path: '/agones.dev.sdk.beta.SDK/UpdateCounter',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.UpdateCounterRequest,
    responseType: beta_pb.Counter,
    requestSerialize: serialize_agones_dev_sdk_beta_UpdateCounterRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_UpdateCounterRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_Counter,
    responseDeserialize: deserialize_agones_dev_sdk_beta_Counter,
  },
  // Gets a List. Returns NOT_FOUND if the List does not exist.
getList: {
    path: '/agones.dev.sdk.beta.SDK/GetList',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.GetListRequest,
    responseType: beta_pb.List,
    requestSerialize: serialize_agones_dev_sdk_beta_GetListRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_GetListRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_List,
    responseDeserialize: deserialize_agones_dev_sdk_beta_List,
  },
  // UpdateList returns the updated List. Returns NOT_FOUND if the List does not exist (name cannot be updated).
// **THIS WILL OVERWRITE ALL EXISTING LIST.VALUES WITH ANY REQUEST LIST.VALUES**
// Use AddListValue() or RemoveListValue() for modifying the List.Values field.
// Returns INVALID_ARGUMENT if the field mask path(s) are not field(s) of the List.
// If a field mask path(s) is specified, but the value is not set in the request List object,
// then the default value for the variable will be set (i.e. 0 for "capacity", empty list for "values").
updateList: {
    path: '/agones.dev.sdk.beta.SDK/UpdateList',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.UpdateListRequest,
    responseType: beta_pb.List,
    requestSerialize: serialize_agones_dev_sdk_beta_UpdateListRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_UpdateListRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_List,
    responseDeserialize: deserialize_agones_dev_sdk_beta_List,
  },
  // Adds a value to a List and returns updated List. Returns NOT_FOUND if the List does not exist.
// Returns ALREADY_EXISTS if the value is already in the List.
// Returns OUT_OF_RANGE if the List is already at Capacity.
addListValue: {
    path: '/agones.dev.sdk.beta.SDK/AddListValue',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.AddListValueRequest,
    responseType: beta_pb.List,
    requestSerialize: serialize_agones_dev_sdk_beta_AddListValueRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_AddListValueRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_List,
    responseDeserialize: deserialize_agones_dev_sdk_beta_List,
  },
  // Removes a value from a List and returns updated List. Returns NOT_FOUND if the List does not exist.
// Returns NOT_FOUND if the value is not in the List.
removeListValue: {
    path: '/agones.dev.sdk.beta.SDK/RemoveListValue',
    requestStream: false,
    responseStream: false,
    requestType: beta_pb.RemoveListValueRequest,
    responseType: beta_pb.List,
    requestSerialize: serialize_agones_dev_sdk_beta_RemoveListValueRequest,
    requestDeserialize: deserialize_agones_dev_sdk_beta_RemoveListValueRequest,
    responseSerialize: serialize_agones_dev_sdk_beta_List,
    responseDeserialize: deserialize_agones_dev_sdk_beta_List,
  },
};

